var vm = new Vue({
	el: '#login',
	data() {
		return {
			userLoginVo: {
				userCode: 'test',
				password: '123456'
			},
			rules: {
				userCode: {
					required: true,
					message: '请输入用户名',
					trigger: 'blur'
				},
				password: {
					required: true,
					message: '请输入密码',
					trigger: 'blur'
				},
			},
			navs: null
		}
	},
	methods: {
		submitForm: function() {
			var that = this
			axios.post(gateway + '/admin/user/login', that.userLoginVo).then(res => {
				if (res.data.code == 000000) {
					console.log('成功',res.data)
					var id = res.data.data
					sessionStorage.setItem('userId', id)
					window.location.href = `../../../index.html?id=${id}`
				} else {
					console.log('失败')
					this.$message(res.msg)
				}
			}).catch(res => {
				console.log('加载失败')
			})
		}
	}
})
